<include file="public@header" />
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li ><a href="{:url('goods/index')}">商品列表管理</a></li>
        <li class="active"><a href="{:url('goods/add')}">添加商品</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('goods/addPost')}">

        <div class="form-group">
            <label for="name" class="col-sm-2 control-label">商品名称</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="name" name="name" style="width: 200px">
            </div>
        </div>

        <div class="form-group">
            <label for="photo-1-preview" class="col-sm-2 control-label">
                照片
            </label>
            <div class="col-md-6 col-sm-10">
                <input id="photo-1" type="hidden" name="image" >
                <input id="photo-1-name" type="text"  title="图片名称" readonly disabled>
                <img id="photo-1-preview" style="width: 50px" >
                    <a href="javascript:uploadOneImage('图片上传','#photo-1');" class="btn-primary btn">上传</a>
            </div>
        </div>

        <div class="form-group">
            <label for="image_more" class="col-sm-2 control-label">图集</label>
            <div class="col-md-6 col-sm-10">
                <div id="image_more"></div>
                <div class="margin-top-10">
                    <a class="btn btn-default" href="javascript:uploadMultiImage('图片上传','#image_more','photos-item-wrapper');">选择图片</a>
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="yf" class="col-sm-2 control-label">运费</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" id="yf" name="yf" style="width: 200px">
            </div>
        </div>

        <div class="form-group">
            <label   class="col-sm-2 control-label">
                商品状态
            </label>
            <div for="status" class="col-md-6 col-sm-10">
                <select name="status" id="status" class="form-control" style="width: 200px">
                    <option>请选择商品状态</option>
                    <option value="0">无货</option>
                    <option value="1" selected>正常</option>
                    <option value="2">下架</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label   class="col-sm-2 control-label">
                经营状态
            </label>
            <div for="jy" class="col-md-6 col-sm-10">
                <select name="jy" id="jy" class="form-control" style="width: 200px">
                    <option>请选择经营状态</option>
                    <option value="0"selected>是</option>
                    <option value="1" >否</option>

                </select>
            </div>
        </div>



        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
            </div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/html" id="photos-item-wrapper">
    <div style="display: flex;align-items: center;border: 1px solid #ddd;padding: 5px;margin-top: 10px"></div>
    <div style="margin-left: 10px">{name}</div>
    <input type="hidden" id="photo-{id}" name="image_more[]" value="{filepath}">
</script>
</body>
</html>